﻿from rrDefine import *

#*******************************************************************************
#
#	TILE
#
#*******************************************************************************

class Tile:
	def __init__(self):
	#by default a tile is blocked and it also blocks sight
		self.blocked=True
		self.block_sight=True
		self.explored=False
		self.seen=False
		self.type=VOID
		self.sprite=' '
		
	def set_type(self,t):
	#changing the type of a tile also modifies several parameters
		if t==VOID:
			self.blocked=True
			self.block_sight=True
			self.type=VOID
			self.sprite=' '
			
		elif t==V_WALL:
			self.blocked=True
			self.block_sight=True
			self.type=V_WALL
			self.sprite='|'		
			
		elif t==H_WALL:
			self.blocked=True
			self.block_sight=True
			self.type=H_WALL
			self.sprite='-'
			
		elif t==X_WALL:
			self.blocked=True
			self.block_sight=True
			self.type=X_WALL
			self.sprite='-'	
			
		elif t==FLOOR:
			self.blocked=False
			self.block_sight=False
			self.type=FLOOR
			self.sprite='.'	
			
		elif t==CORRIDOR:
			self.blocked=False
			self.block_sight=False
			self.type=CORRIDOR
			self.sprite='#'	
			
		elif t==U_DOOR:
			self.blocked=True
			self.block_sight=True
			self.type=U_DOOR
			self.sprite='+'	
			
		elif t==L_DOOR:
			self.blocked=True
			self.block_sight=True
			self.type=L_DOOR
			self.sprite='+'	
			
		elif t==O_DOOR:
			self.blocked=False
			self.block_sight=False
			self.type=O_DOOR
			self.sprite='.'	
			
		elif t==LAVA:
			self.blocked=False
			self.block_sight=False
			self.type=LAVA
			self.sprite='~'	
			
		elif t==WATER:
			self.blocked=False
			self.block_sight=False
			self.type=WATER
			self.sprite='~'
			